home *** CD-ROM | disk | FTP | other *** search
Text File | 1998-10-26 | 5.5 KB | 209 lines | [TEXT/ScoM] |
- In the following code I'm trying to make some melodies which get selected
- randomly. I get an illegal symbol value in the def-symbol. Also the def-length
- uses the latest entry (all eighth notes). How can I somehow connect the
- melody with its lengths.? (riff1=r1len)
-
- ;random berry wheel generator
- ;riffs are berry leads + or - n adds accidentals
- ;how to keep melody with specific ryhtymn?
-
- (setq riff1 '(df df df (-1 c e) a (-1 c e)))
- (setq riff2 '(he df (-1 c e) a he df (-1 c) e a))
-
- (def-length
- r1len '(1/4 1/4 1/8 1/8 1/8 1/8)
- r2len '(1/8 1/8 1/8 1/8 1/8 1/8))
-
- (def-channel
- lead 1)
-
- (def-tonality
- lead (activate-tonality (major f 5)))
-
- (setq rifzone1 (bars-to-zones '(1) '(4/4)))
- (setq rifzone2 (bars-to-zones '(1) '(4/4)))
-
- several errors in the following:
-
- (def-symbol
- lead (append (gen-random 0.12 32 (list rifzone1 rifzone2))))
-
- error1: you cannot use rifzones to define symbols, they are zones
- that you are using to define zones.
- error2: you are appending...but you are not appending anything,
- append has only one argument which is the (gen-random ...).
-
- (midiport :modem)
- (def-tempo 120)
- (compile-instrument "ccl;output:" "aberry wheel" lead)
-
- to select elements randomly use pick-random.
-
-
- (setq random-seed 0.123)
-
- (setq riff1 '(df df df (-1 c e) a (-1 c e)))
- (setq riff2 '(he df (-1 c e) a he df (-1 c) e a))
-
- (setq r1len '(1/4 1/4 1/8 1/8 1/8 1/8))
- (setq r2len '(1/8 1/8 1/8 1/8 1/8 1/8))
-
- ; initialize random generator with the seed value, and pick up a random
- ; value from riff1 and riff2
-
- (init-rnd random-seed)
- (setq random-symbol (pick-random (list riff1 riff2)))
-
- ; intialize the random generator again to ensure that it picks up the
- ; corresponding length pattern. If you want to select also the length
- ; pattern randomly then initialize the generator with another seed.
- ; Notice that you must change the seed each time when you evaluate the
- ; file, otherwise it produces each time the same piece.
-
- (init-rnd random-seed)
- (setq random-length (pick-random (list r1len r2len)))
-
- ; define the symbol and length contents for instr1
-
- (def-symbol
- instr1 random-symbol
- )
-
- (def-length
- instr1 random-symbol
- )
-
- ;;;;;;;;;if you are targeting to pick up matching symbol lenght pairs
-
- ; here you set up source material in a list. The list contains
- ; lists of symbols and corresponding lenghts.
-
- (setq source-material '(
- ; first symbol length pair
- ((df df df (-1 c e) a (-1 c e))
- (1/4 1/4 1/8 1/8 1/8 1/8))
- ; second
- ((he df (-1 c e) a he df (-1 c) e a)
- (1/8 1/8 1/8 1/8 1/8 1/8))
- ; add any number of similar pairs ..
- ))
-
- (init-rnd 0.123)
- (setq random-pair (pick-random source-material))
-
- ; now random-pair contains a pair list ((df df df (-1 c e) a (-1 c e)) (1/4 1/4 1/8 1/8 1/8 1/8))
-
- ; set the first element to random-symbol
-
- (setq random-symbol (nth 0 random-pair))
-
- ; set the second element to random-lenght
-
- (setq random-length (nth 1 random-pair))
-
- (def-symbol
- instr1 random-symbol
- )
-
- (def-length
- instr1 random-symbol
- )
-
-
- ;;
-
- >I got my random chuck berry solo wheel to start working. but I feel the
- >solution is not very elegalant. The following code shows the progress.
- >
- >;random berry wheel generator
- >;riffs are berry leads + or - n adds accidentals
- >;how to keep melody with specific ryhtymn?
- >(setq riff1 '(df df df (-1 c e) a (-1 c e)))
- >(setq riff2 '(he df (-1 c e) a he df (-1 c e) a))
- >(setq riff3 '(he he he he he df (-1 c e) df))
- >
- >(def-length
- > lead1 '(1/4 1/4 1/8 1/8 1/8 1/8)
- > lead2 '(1/8 1/8 1/8 1/8 1/8 1/8))
- >
- >(def-channel
- > lead1 1
- > lead2 1
- >)
- >
- >(def-tonality
- > lead1 (activate-tonality (major f 5))
- > lead2 (activate-tonality (major f 5)))
- >
- >(setq rifzone1 (bars-to-zones '(-1 1 -1 1) '(4/4 4/4 4/4 4/4)))
- >(setq rifzone2 (bars-to-zones '(1 -1 1 -1) '(4/4 4/4 4/4 4/4)))
- >
- >(def-zone
- > lead1 rifzone1
- > lead2 rifzone2)
- >
-
- you dont need the append here
-
- >(def-symbol
- > lead1 (append (gen-random 0.12 32 (list riff1 riff2)))
- > lead2 (append (gen-random 0.12 32 (list riff2 riff3))))
- >
- >(midiport :modem)
- >(def-tempo 120)
- >(compile-instrument "ccl;output:" "aberry wheel" lead1 lead2)
- >
- >I want to add some percussion now. How do I do that using zones?
- >
- >In nigel's tutorial he says to evaluate the expression mt-32 to view drum
- >mapping. I tried that and got "null complier" I tried (setq percussion mt-32)
- >and just got note numbers. Do you have to activate-tonality mt-32 for drums?
-
- You can examine things and learn to find solutions to problems like
- the above by yourself. I'll show you how. Highlite the following
-
- (activate-tonality (major f 5))
-
- and the press eval button (one shimney)
-
- you'll get
-
- --> ((f 5 g 5 a 5 |A#| 5 c 6 d 6 e 6))
-
- Now, highlite mt-32 and press the eval button (one shimney).
- What do you get?
-
- You'll get
-
- -->((b 2 c 3 c# 3 d 3 d# 3 e 3 f 3 f# 3 g# 3 a 3 a# 3 c 4 c# 4 d# 4 f# 4 g# 4 c 5 c# 5 d 5 d# 5 e 5 f 5 f# 5 g 5 g# 5 a 5 a# 5 b 5 c 6 c# 6 d# 6))
-
- By a quick look you can say they both represent tonalities.
-
- Since now you know that mt-32 is a tonality you can use it to define
- a tonality for an instrument.
-
- (def-tonality
- lead1 (activate-tonality (major f 5))
- lead2 (activate-tonality (major f 5))
- drums mt-32
- )
-
- Try the following, when you compile it what do you get? Try to
- predict that before compilation, and compare the prediction to what
- you get.
-
- (def-symbol
- drums '(a b c)
- )
-
- >One more problem is that I can't seem to assign programs for my gm module.
- >(def-program gm-sound-set
- > lead electric-gutair-clean)
- >
-
- When you get errors, check first that it is spelled right ;-). This
- will work.
-
- (def-program gm-sound-set
- lead electric-guitar-clean)
-